spaceranger count --id=hd_count \
--transcriptome=/path/to/refdata-gex-GRCh38-2020-A \
--fastqs=/path/to/fastq \
--probe-set=/path/to/Visium_Human_Transcriptome_Probe_Set_v2.0_GRCh38-2020-A.csv \
--slide=H1-YD7CDZK \
--area=A1 \
--cytaimage=/path/to/CAVG10539_2023-11-16_14-56-24_APPS115_H1-YD7CDZK_A1_S11088.tif \
--image=/path/to/APPS115_11088_rescan_01.btf \
--create-bam=falseVisium HD Analysis
Approximate time: 2 hours and 45 minutes
Learning Objectives
- Describe the elements of the Seurat object and how they are generated
- Visually inspect and compare spatial scRNA-seq data before and after filtering
- Execute clustering workflows and visualize results on a tissue section
- Annotate celltypes using both spatial and gene expression information
Visium HD
Mouse Brain Visium HD Dataset
The Visium HD platform is compatible with human and mouse fresh frozen, fixed frozen, and formalin-fixed paraffin-embedded (FFPE) tissue sections. For this lesson, we will be working with data from a fresh frozen coronal section of a mouse brain sample.
Each Visium HD slide has the same 6.5 x 6.5mm capture area as previous Visium products but is covered with about 11 million tiles. These 2µm x 2µm squares are arrayed in a continuous lawn across the entire capture area. The squares are each uniquely barcoded with an oligonucleotide and contain probes allowing for the detection of the full coding transcriptome. As such, Visium HD is categorized as a sequencing-based technology.
These methods utilize floresence to quantify gene expression on a tissue slide. Specifically utilizing fluoresence in situ hybridization (FISH) to measure expression of a select panel of genes (selected by the researcher) using probes. Therefore we are able to evaluate the expression for each individual cell after segmentation.
Some popular imaging-based technologies include:
- seqFISH
- MERFISH
- Xenium
Preprocessing Data with Spaceranger
Sequencing facilities often output scRNA-seq data, including spatial scRNA-seq data, in FASTQ format. Because this is Visium HD data from 10X Genomics, we used their proprietary pre-processing software Space Ranger to process the FASTQ files into a count matrix and other images. Specifically, the spaceranger count command aligns the reads in the FASTQ files against a transcriptomic reference and provides their spatial location using the oligonucleotide barcode.
Note that Space Ranger requires a Linux system with at least 32 cores, 64GB of RAM, and 1TB of disk space.
spaceranger count
A sample command for running spaceranger count is:
When spaceranger count completes successfully, it will generate a variety of outputs (seen below), which will enable the analyst to perform further analysis in R/Python or using the proprietary Loupe browser from 10X Genomics.
We can view and explore the web summary HTML of our data found in the “reports” folder of your project.
In the Visium HD assay, Space Ranger also bins the data in square of various sizes, including:
- 2µm x 2µm bins
- 8µm x 8µm bins
- 16µm x 16µm bins
The single-digit micron resolution is a big technological improvement over original Visium’s original ∼55μm spots. Having access to 2μm bins along with matching morphology information provides a great opportunity for reconstructing single cells from the data, which is undoubtedly very powerful.
However, because the 2µm x 2µm squares (and even the 8µm x 8µm bins) are so small, there is a potential for very little biological signal to be captured per bin. Additionally, the sheer number of bins at these higher resolutions can present challenges in terms of computational time and resources.
For this lesson, we will use the 16µm x 16µm bins of the cropped Visium HD slide to run locally on laptops.
NGS-based Spatial Transcriptomics Analysis workflow
The overarching steps for analyzing a sequencing-based transcriptomics dataset is as follows:
Setting Up in R
Downloading the Data
For this module, we will be working within an RStudio project. In order to follow along you should have downloaded the R project.
If you haven’t done this already, the project is located in “Dataset for workshop” -> “Day 2- NGS-based- VisiumHD” in the course DropBox.
Once downloaded, you should see a file called visiumHD_nanocourse.zip on your computer (likely, in your Downloads folder).
Unzip this file. This will result in a folder of the same name.
Move the folder to the location on your computer where you would like to perform the analysis.
Open up the folder. The contents will look like the screenshot below:
Locate the
.Rproj fileand double-click on it. This will open up RStudio with the “visiumHD_nanocourse” project loaded.Open a new Rscript file.
Start with some comments to indicate what this file is going to contain:
# February 26th, 2025
# Spatial Transcriptomics: Session 2Save the Rscript in the
codefolder asvisiumHD.R. Your working directory should look something like this: